
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for reportInfo.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="reportInfoForm"
 */
public class ReportInfoForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _rptGuid = null;
   private java.lang.String _rptCode = null;
   private java.lang.String _rptName = null;
   private java.lang.String _rptDesc = null;
   private java.lang.String _moduleName = null;
   private java.lang.String _ascGuid = null;
   private java.lang.String _userName = null;
   private java.lang.String _createTime = null;

   /**
    * Standard constructor.
    */
   public ReportInfoForm() {
   }

   /**
    * Returns the rptGuid
    *
    * @return the rptGuid
    */
   public java.lang.String getRptGuid() {
      return _rptGuid;
   }

   /**
    * Sets the rptGuid
    *
    * @param rptGuid the new rptGuid value
    */
   public void setRptGuid(java.lang.String rptGuid) {
      _rptGuid = rptGuid;
   }
   /**
    * Returns the rptCode
    *
    * @return the rptCode
    */
   public java.lang.String getRptCode() {
      return _rptCode;
   }

   /**
    * Sets the rptCode
    *
    * @param rptCode the new rptCode value
    */
   public void setRptCode(java.lang.String rptCode) {
      _rptCode = rptCode;
   }
   /**
    * Returns the rptName
    *
    * @return the rptName
    */
   public java.lang.String getRptName() {
      return _rptName;
   }

   /**
    * Sets the rptName
    *
    * @param rptName the new rptName value
    */
   public void setRptName(java.lang.String rptName) {
      _rptName = rptName;
   }
   /**
    * Returns the rptDesc
    *
    * @return the rptDesc
    */
   public java.lang.String getRptDesc() {
      return _rptDesc;
   }

   /**
    * Sets the rptDesc
    *
    * @param rptDesc the new rptDesc value
    */
   public void setRptDesc(java.lang.String rptDesc) {
      _rptDesc = rptDesc;
   }
   /**
    * Returns the moduleName
    *
    * @return the moduleName
    */
   public java.lang.String getModuleName() {
      return _moduleName;
   }

   /**
    * Sets the moduleName
    *
    * @param moduleName the new moduleName value
    */
   public void setModuleName(java.lang.String moduleName) {
      _moduleName = moduleName;
   }
   /**
    * Returns the ascGuid
    *
    * @return the ascGuid
    */
   public java.lang.String getAscGuid() {
      return _ascGuid;
   }

   /**
    * Sets the ascGuid
    *
    * @param ascGuid the new ascGuid value
    */
   public void setAscGuid(java.lang.String ascGuid) {
      _ascGuid = ascGuid;
   }
   /**
    * Returns the userName
    *
    * @return the userName
    */
   public java.lang.String getUserName() {
      return _userName;
   }

   /**
    * Sets the userName
    *
    * @param userName the new userName value
    */
   public void setUserName(java.lang.String userName) {
      _userName = userName;
   }
   /**
    * Returns the createTime
    *
    * @return the createTime
    */
   public java.lang.String getCreateTime() {
      return _createTime;
   }

   /**
    * Sets the createTime
    *
    * @param createTime the new createTime value
    */
   public void setCreateTime(java.lang.String createTime) {
      _createTime = createTime;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getRptGuid() == null) {
         errors.add("rptGuid", new ActionError("error.rptGuid.required"));
      }
      if(getRptCode() == null) {
         errors.add("rptCode", new ActionError("error.rptCode.required"));
      }
      // TODO test format/data
      return errors;
   }
}
